diff options
| author | diogo464 <[email protected]> | 2025-08-12 16:24:14 +0100 |
|---|---|---|
| committer | diogo464 <[email protected]> | 2025-08-12 16:24:14 +0100 |
| commit | 507d9ee9ae524edd4e39942b735d987aa5d48359 (patch) | |
| tree | 056721408b0fa1c7e55916376ea5508febea90a2 /frontend/app/v2/[...path] | |
| parent | 519bb45b89591b78b3ef65e4b937c53482552887 (diff) | |
Convert V2 UI to server-side data loading
- Convert page components to async server components using Drive_ls()
- Split V2DirectoryView into server component (data processing) and V2DirectoryClient (interactivity)
- Remove client-side useEffect + fetch API calls for directory listing
- Data now loaded server-side and passed as props for better static rendering
- Mutations still use page refresh to show updated data
🤖 Generated with [Claude Code](https://claude.ai/code)
Co-Authored-By: Claude <[email protected]>
Diffstat (limited to 'frontend/app/v2/[...path]')
| -rw-r--r-- | frontend/app/v2/[...path]/page.tsx | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/frontend/app/v2/[...path]/page.tsx b/frontend/app/v2/[...path]/page.tsx index 4af0167..3b4cbb8 100644 --- a/frontend/app/v2/[...path]/page.tsx +++ b/frontend/app/v2/[...path]/page.tsx | |||
| @@ -1,4 +1,5 @@ | |||
| 1 | import { V2DirectoryView } from "@/components/v2/V2DirectoryView" | 1 | import { V2DirectoryView } from "@/components/v2/V2DirectoryView" |
| 2 | import { Drive_ls } from "@/lib/drive_server" | ||
| 2 | 3 | ||
| 3 | export default async function V2DirectoryPage({ | 4 | export default async function V2DirectoryPage({ |
| 4 | params, | 5 | params, |
| @@ -7,6 +8,7 @@ export default async function V2DirectoryPage({ | |||
| 7 | }) { | 8 | }) { |
| 8 | const { path: pathSegments } = await params | 9 | const { path: pathSegments } = await params |
| 9 | const currentPath = '/' + (pathSegments?.join('/') || '') | 10 | const currentPath = '/' + (pathSegments?.join('/') || '') |
| 10 | 11 | ||
| 11 | return <V2DirectoryView path={currentPath} /> | 12 | const files = await Drive_ls(currentPath, false) |
| 13 | return <V2DirectoryView path={currentPath} files={files} /> | ||
| 12 | } \ No newline at end of file | 14 | } \ No newline at end of file |
